package com.xique.door.bean.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xique.common.core.annotation.Excel;
import com.xique.common.core.web.domain.BaseEntity;
import com.xique.common.datascope.annotation.NeedSetValue;
import com.xique.door.mapper.UserMapper;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 卡片对象 d_card
 *
 * @author ww
 * @date 2021-09-14
 */
@Data
public class DCard extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键id */
    private Long id;

    /** 小区id */
    @Excel(name = "所属小区", readConverterExp = "小区")
    private Long parkId;

    /** 用户（业主）id */
    @Excel(name = "用户", readConverterExp = "业=主")
    private Long userId;

    @NeedSetValue(beanClass = UserMapper.class, params = "userId", method = "selectUserById",targetFiled = "userName")
    private String userName;

    /**业主用户的唯一标识*/
    private String customId;

    /** 卡片外部编号（可以没有） */
    @Excel(name = "卡片外部编号", readConverterExp = "可=以没有")
    private String cardExternalNo;

    /** 卡片读出来的卡号 */
    @Excel(name = "卡片读出来的卡号")
    private String cardSn;

    /** 卡片类型 */
    @Excel(name = "卡片类型")
    private String cardType;

    /** 门禁有效期起始日期 */
    @Excel(name = "门禁有效期起始日期", width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date doorBeginDate;

    /** 门禁有效期截至日期 */
    @Excel(name = "门禁有效期截至日期", width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date doorEndDate;

    /** 梯控有效期起始日期 */
    @Excel(name = "梯控有效期起始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date elevatorBeginDate;

    /** 梯控有效期截至日期 */
    @Excel(name = "梯控有效期截至日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date elevatorEndDate;

    /** 状态 */
    @Excel(name = "状态")
    private String status;

    /** 创建人 */
    @Excel(name = "创建人")
    private Long createUser;

    /** 更新人 */
    @Excel(name = "更新人")
    private Long updateUser;

    /** 创建人账号 */
    //使用注解定义在参数上
//    @NeedSetValue(beanClass = SysUserMapper.class, params = "createUser", method = "selectUserById",targetFiled = "userName")
    @Excel(name = "创建人")
    private String createUserName;

    /** 更新人账号 */
//    @NeedSetValue(beanClass = SysUserMapper.class, params = "updateUser", method = "selectUserById",targetFiled = "userName")
    @Excel(name = "更新人")
    private String updateUserName;

    @ApiModelProperty("类型：1永久；2临时")
    private String type;

    @ApiModelProperty("记录原始卡id，删除卡时用到")
    private String originCardSn;

    @ApiModelProperty("房号，下发海清梯控使用")
    private String floorCode;

    private String houseIds;
    private List<String> cardSns;
    private  List<CardDevice> cardDevices;
    /** true代表挂失 false代表解挂 null表示正常 */
    private Boolean isLoss;

    private Integer personType;

    private String deviceCardId;

    private Long houseCardId;


}
